using System;
using System.Collections.Generic;
using System.Text;
using Shc.Sql;
using Shc.Json;
namespace Slqj.Data
{
	public static class TableTicketType
	{
		public const string Table = "TicketType";
		public const string TicketTypeID = "TicketTypeID";
		public const string TicketTypeName = "TicketTypeName";
	}
	
	[Serializable]
	public class BaseTicketType
		: IDbSessionEntity, IJsonClass
	{
		int m_TicketTypeID;
		/// <summary>
        /// 门票类型表ID
        /// </summary>
        public int TicketTypeID
        {
            get { return m_TicketTypeID; }
            set { m_TicketTypeID = value; }
        }
		
		string m_TicketTypeName;
		/// <summary>
        /// 门票类型名称
        /// </summary>
        public string TicketTypeName
        {
            get { return m_TicketTypeName; }
            set { m_TicketTypeName = value; }
        }
		
		
		#region IDbSessionEntity Members
		public void ReadDBData(RowDataReader reader)
        {
            m_TicketTypeID = reader[TableTicketType.TicketTypeID];
            m_TicketTypeName = reader[TableTicketType.TicketTypeName];
        }
		
		public void WriteDBData(RowDataWriter writer)
        {
            writer.SetPrimaryKey(TableTicketType.TicketTypeID, PrimaryKeyType.Identity, TicketTypeID);
			writer[TableTicketType.TicketTypeName] = TicketTypeName;
        }

        public void SetIdentityAfterInsert(DBObject idd)
        {
            m_TicketTypeID = idd;
        }
		
		public string TableName
        {
            get { return TableTicketType.Table; }
        }
		#endregion
		
		#region IJsonClass Members

        public void JsonDeSerializeObj(JsonHashTable hashToRead)
        {
             m_TicketTypeID = hashToRead["TicketTypeID"];
			 
             m_TicketTypeName = hashToRead["TicketTypeName"];
			 
        }

        public void JsonSerializeObj(JsonHashTable hashToFill)
        {
            hashToFill["TicketTypeID"] = TicketTypeID;
			 
            hashToFill["TicketTypeName"] = TicketTypeName;
			 
        }

        #endregion
		
	}
}
